//
//  XBSearchViewController.m
//  Found
//
//  Created by 唐后能 on 16/4/4.
//  Copyright © 2016年 itheima. All rights reserved.
//

#import "XBSearchViewController.h"

@interface XBSearchViewController ()
@property (weak, nonatomic) IBOutlet UITextField *textField;
@property (weak, nonatomic) IBOutlet UIBarButtonItem *cancelBarBtn;

@end

@implementation XBSearchViewController
// 取消.
- (IBAction)cancel:(UIBarButtonItem *)sender {
    //    [self.navigationController popToRootViewControllerAnimated:NO];
    [self dismissViewControllerAnimated:NO completion:nil];
}

- (void)viewDidLoad {
    
    
    [super viewDidLoad];
    // 注册cell.
//    [self.tableView registerNib:[UINib nibWithNibName:@"SsarchViewCell" bundle:nil] forCellReuseIdentifier:reuserIdentifier];
    //去除分割线.
    self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    // 设置文本框的frame.
    self.textField.frame = CGRectMake(10, 0, 400, 30);
    
    // 设置第一响应者.
    [self.textField becomeFirstResponder];
}

#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {

    return 1;
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"search" forIndexPath:indexPath];
    return cell;
}

#pragma mark - Table view 代理方法.
- (NSString*)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {

    if (section==0) {
        return @"热门搜索";
    }
    return nil;
}

@end
